package publics.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name="employee")
public class Employee {//银行员工
	
	private Integer id;//ID                Integer not null,
	private String loginUser;//员工登陆账号       varchar(20) not null,
	private String loginPass;//密码        varchar(20) not null,
	private String staffNo;//员工工号          varchar(20),
	private String name;//姓名              varchar(4) not null,
	private Integer sex;//性别               Integer not null,
	private Date birthday;//出生年月          date,
	private String idd;//身份证号               char(19) not null,
	
	private Ethnic ethnic;//民族 （外键）
//	private String nation;//民族            varchar(5) not null,
	
	private Integer politicsStatus;//政治面貌   Integer not null,
	private Integer maritalStatus;//婚姻状况    Integer not null,
	private Integer education;//最高学历         int not null,
	private String school;//毕业院校            varchar(20) not null,
	private String position;//职位          varchar(10) not null,
	private String belongedBank;//所在支行或总行     varchar(30) not null,
	private Date entryDate;//入职年月        date not null,
	private String phone;//联系电话             varchar(12) not null,
	private String email;//电子邮箱             varchar(50) not null,
	private String postAddress;//通信地址     varchar(50) not null,
	private String postNum;//邮政编码          char(6) not null,
	private String remarks;//备注           varchar(50),
	private Date checkTime;//审核时间        datetime not null,
	
	private Right right;//权限等级 （默认）  int not null,
//	private Integer authorityLevel;//权限等级 （默认）  int not null,
	
	@Id
	@GeneratedValue
	@Column(name="Em_id")
	public Integer getId() {
		return id;
	}
	@Column(name="Em_login_user")
	public String getLoginUser() {
		return loginUser;
	}
	@Column(name="Em_login_pass")
	public String getLoginPass() {
		return loginPass;
	}
	@Column(name="Em_staff_no")
	public String getStaffNo() {
		return staffNo;
	}
	@Column(name="Em_name")
	public String getName() {
		return name;
	}
	@Column(name="Em_sex")
	public Integer getSex() {
		return sex;
	}
	@Column(name="Em_birthday")
	public Date getBirthday() {
		return birthday;
	}
	@Column(name="Em_idd")
	public String getIdd() {
		return idd;
	}
/*	@Column(name="Em_nation")
	public String getNation() {
		return nation;
	}*/
	@ManyToOne
	@JoinColumn(name="Eth_id",nullable=false)
	public Ethnic getEthnic() {
		return ethnic;
	}
	
	@Column(name="Em_politics_status")
	public Integer getPoliticsStatus() {
		return politicsStatus;
	}
	@Column(name="Em_marital_status")
	public Integer getMaritalStatus() {
		return maritalStatus;
	}
	@Column(name="Em_education")
	public Integer getEducation() {
		return education;
	}
	@Column(name="Em_school")
	public String getSchool() {
		return school;
	}
	@Column(name="Em_position")
	public String getPosition() {
		return position;
	}
	@Column(name="Em_belonged_bank")
	public String getBelongedBank() {
		return belongedBank;
	}
	@Column(name="Em_entry_date")
	public Date getEntryDate() {
		return entryDate;
	}
	@Column(name="Em_phone")
	public String getPhone() {
		return phone;
	}
	@Column(name="Em_email")
	public String getEmail() {
		return email;
	}
	@Column(name="Em_post_address")
	public String getPostAddress() {
		return postAddress;
	}
	@Column(name="Em_post_num")
	public String getPostNum() {
		return postNum;
	}
	@Column(name="Em_remarks")
	public String getRemarks() {
		return remarks;
	}
	@Column(name="Em_check_time")
	public Date getCheckTime() {
		return checkTime;
	}
/*	@Column(name="Em_authority_level")
	public Integer getAuthorityLevel() {
		return authorityLevel;
	}*/
	@ManyToOne
	@JoinColumn(name="Rig_id",nullable=false)
	public Right getRight() {
		return right;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	public void setLoginUser(String loginUser) {
		this.loginUser = loginUser;
	}
	public void setLoginPass(String loginPass) {
		this.loginPass = loginPass;
	}
	public void setStaffNo(String staffNo) {
		this.staffNo = staffNo;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public void setIdd(String idd) {
		this.idd = idd;
	}
	public void setEthnic(Ethnic ethnic) {
		this.ethnic = ethnic;
	}
	public void setPoliticsStatus(Integer politicsStatus) {
		this.politicsStatus = politicsStatus;
	}
	public void setMaritalStatus(Integer maritalStatus) {
		this.maritalStatus = maritalStatus;
	}
	public void setEducation(Integer education) {
		this.education = education;
	}
	public void setSchool(String school) {
		this.school = school;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public void setBelongedBank(String belongedBank) {
		this.belongedBank = belongedBank;
	}
	public void setEntryDate(Date entryDate) {
		this.entryDate = entryDate;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public void setPostAddress(String postAddress) {
		this.postAddress = postAddress;
	}
	public void setPostNum(String postNum) {
		this.postNum = postNum;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	public void setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
	}
/*	public void setAuthorityLevel(Integer authorityLevel) {
		this.authorityLevel = authorityLevel;
	}*/
	public void setRight(Right right) {
		this.right = right;
	}
	
	
	public Employee() {
		super();
	}
	
	public Employee(Integer id, String loginUser, String loginPass, String staffNo,
			String name, Right right) {
		super();
		this.id = id;
		this.loginUser = loginUser;
		this.loginPass = loginPass;
		this.staffNo = staffNo;
		this.name = name;
		this.right = right;
	}
	public Employee(Integer id, String loginUser, String loginPass, String staffNo,
			String name, Integer sex, Date birthday, String idd, Ethnic ethnic,
			Integer politicsStatus, Integer maritalStatus, Integer education,
			String school, String position, String belongedBank,
			Date entryDate, String phone, String email, String postAddress,
			String postNum, String remarks, Date checkTime, Right right) {
		super();
		this.id = id;
		this.loginUser = loginUser;
		this.loginPass = loginPass;
		this.staffNo = staffNo;
		this.name = name;
		this.sex = sex;
		this.birthday = birthday;
		this.idd = idd;
		this.ethnic = ethnic;
		this.politicsStatus = politicsStatus;
		this.maritalStatus = maritalStatus;
		this.education = education;
		this.school = school;
		this.position = position;
		this.belongedBank = belongedBank;
		this.entryDate = entryDate;
		this.phone = phone;
		this.email = email;
		this.postAddress = postAddress;
		this.postNum = postNum;
		this.remarks = remarks;
		this.checkTime = checkTime;
		this.right = right;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Employee [right=" + right + ", belongedBank="
				+ belongedBank + ", birthday=" + birthday + ", checkTime="
				+ checkTime + ", education=" + education + ", email=" + email
				+ ", entryDate=" + entryDate + ", id=" + id + ", idd=" + idd
				+ ", loginPass=" + loginPass + ", loginUser=" + loginUser
				+ ", maritalStatus=" + maritalStatus + ", name=" + name
				+ ", ethnic=" + ethnic + ", phone=" + phone
				+ ", politicsStatus=" + politicsStatus + ", position="
				+ position + ", postAddress=" + postAddress + ", postNum="
				+ postNum + ", remarks=" + remarks + ", school=" + school
				+ ", sex=" + sex + ", staffNo=" + staffNo + "]";
	}
	
	
	

}
